// TODO: 统一处理 Nuxt asyncData
export default function useAsyncData (type, ...rest) {
  return async function (context) {
    const { store } = context

    try {
      return await store.dispatch(type, ...rest)
    } catch (error) {
      console.log(error)
    }
  }
}
